<template>
    <div class="pages" v-if="signalsRadio1.total > 10">
        <div style="display: flex; justify-content: space-between;">
            <div></div>
            <el-pagination small background layout="prev, pager, next" :total="signalsRadio1.total" class="mt-4"
                @current-change="handleCurrentChange" />
        </div>
    </div>
</template>

<script setup>
import { ref } from "vue";
import { useRadio1Store } from "@/pain/search/search";
import { useCounterVip } from "@/pain/vip/index.js";
import { decrypt } from "@/utils/index";
const useVip = useCounterVip();
const signalsRadio1 = useRadio1Store();
const currentPage = ref(1);
const tokens = localStorage.getItem("token")
let token = JSON.parse(decrypt(tokens))

const handleCurrentChange = (val) => {
    if (val > 1 && token.level_id < 2) {
        useVip.maskShow = true
        return
    }
    currentPage.value = val;
    signalsRadio1.xiangqing_pages.currentPage = val;
    console.log(signalsRadio1.xiangqing_pages)
    if (signalsRadio1.xiangqing_id == '1') {
        signalsRadio1.getcompany_details()
    } else if (signalsRadio1.xiangqing_id == '2') {
        signalsRadio1.getcompany_detail_zbs()
    } else if (signalsRadio1.xiangqing_id == '3') {
        signalsRadio1.getcompany_detail_wzbs()
    } else if (signalsRadio1.xiangqing_id == '7') {
        signalsRadio1.getcompetitors()
    }
};




// defineExpose({ currentPage , pageSize })
</script>

<style lang="scss" scoped>
.pages {
    padding: 20px;
}
</style>